package com.os.ordersystem.service.impl;

import com.os.ordersystem.bean.Notice;
import com.os.ordersystem.mapper.NoticeMapper;
import com.os.ordersystem.service.NoticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public int addNotice(Notice notice) {
        return noticeMapper.insert(notice);
    }

    @Override
    public long getTotal(String title) {
        return noticeMapper.getTotal(title);
    }

    @Override
    public List<Notice> getByPage(Map<String, Object> map) {
        return noticeMapper.getByPage(map);
    }

    @Override
    public int delNoticeById(Integer id) {
        return noticeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeMapper.updateByPrimaryKey(notice);
    }
}
